<?
session_start();
 
 //Include File
require_once("include/config.inc.php");
require_once("class/DBFunction.class.php");

//New Class
$dbfunc = new DBFunction();

//Connect Database
$dbfunc->connect(host,usernm,passwd,dbname,charset);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
.topnav {
	float: left;
	width: 213px;
	padding: 20px 28px 20px 0;
	margin-top:5px;
	border-right: 2px solid #FFF;
	font-family: "CenturyGothicRegular", "Century Gothic", Arial, Helvetica, sans-serif;
	text-align: right;
	padding: 0;
}

ul.topnav {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 1em;
	line-height: 0.5em;
}

ul.topnav li {}

ul.topnav li a {
	line-height: 20px;
	font-size: 20px;
	padding: 10px 5px;
	color: #000;
	display: block;
	text-decoration: none;
	font-weight: bolder;
}

ul.topnav li a:hover {}

ul.topnav li ul.subnav {
	list-style: none;
	margin: 0;
	padding: 0;
	display: none;
}

ul.topnav li ul.subnav li {
	margin: 0;
	padding: 0;
	clear: both;
}

html ul.topnav li ul.subnav li a {
	padding-left: 20px;
	font-size: 14px;
	font-weight: normal;
}

html ul.topnav li ul.subnav li a:hover {
	/*--Hover effect for subnav links--*/
}
</style>
<script type="text/javascript" src="component/21_jquery_slide_down_menu/jquery-1.5.2.min.js"></script>
<script language="JavaScript">
$(document).ready(function() {

	//avoid jumping to the top of the page when the href is an #
	$("ul.topnav > li").each(function(index) {
		if($(this).find("ul.subnav").size() != 0){
			if($(this).find("a:first-child").attr('href') == "#"){
	  			$(this).click(function(){return false;});
	  		}
		}
	});
	
	$("ul.topnav li").click(function() { //When trigger is clicked...
		//Do nothing when the list is open
		if(!$(this).find("ul.subnav").is(':visible')){
			$(this).parent().find("ul.subnav").slideUp('fast');	
			$(this).find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
		}
	});
});
</script>
</head>
<body>
<ul class="topnav">
	<li><a href="?page=home">Home</a></li>
	<li><a >Menu</a>
	<ul class="subnav" style="display: block">
        <li><a href="?page=student">สมัครสมาชิก</a></li>
 	    <li><a href="?page=login">เข้าสู่ระบบ</a></li>
        <? if( $_SESSION['sess_stustatus']=="1"){ ?>
        <li><a href="?page=show_student">จัดการผู้ใช้ทั้งหมด</a></li>
        <li><a href="?page=logout">ออกจากระบบ</a></li>
  <? }?>
   <? if( $_SESSION['sess_stustatus']=="2"){ ?>
         <li><a href="?page=edit_student1">แก้ไขข้อมูลส่วนตัว</a></li>
         <li><a href="?page=logout">ออกจากระบบ</a></li>
  <? }?>
        
        
        
	</ul>
	</li>
	<li><a>Picture</a>
	<ul class="subnav">
		 <? if( $_SESSION['sess_stustatus']=="1"){ ?>
         <li><a href="?page=showpic">แสดงรูปภาพรวม</a></li>
         <li><a href="?page=uploadpic">อัพโหลดรูปภาพรวม</a></li>
         <? }?>
         <? if( $_SESSION['sess_stustatus']=="2"){ ?>
        <li> <a href="?page=showpic">แสดงรูปภาพรวม</a></li>
        <li><a href="?page=uploadpic">อัพโหลดรูปภาพรวม</a></li>
       <? }?>
	</ul>
	</li>
</ul>
</body>
</html>